/* Copyright 203-2115 AtomWare Technology Pty Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * The flowing information must be keep 
 * ChatMessage.java
 * netty-socket-io
 * 2013年9月9日下午5:38:17
 * @author 屈甲康
 * QQ285799123
 * mailto:qujiakang@gmail.com
 */

package org.jackysoft.entity.nosql;

import org.joda.time.DateTime;

public class ChatMessage extends AbstractNetMessage {

	/**
	 * 
	 */
	private static final long serialVersionUID = -149133825340706661L;
	private UserInfo sender;
	private UserInfo receiver;
	private long datetime;
	private String roomKey = "all";
	private String labelColor;

	public ChatMessage() {
		super();
		this.pattern = "<b style='color:%s'>%s</b> [%s] - <small>%s</small><br/>%s";
		datetime = DateTime.now().getMillis();
	}

	@Override
	public String toString() {
		return this.getContent();
	}

	public long getDatetime() {
		return datetime;
	}

	public void setDatetime(long datetime) {
		this.datetime = datetime;
	}

	public String getRoomKey() {
		return roomKey;
	}

	public void setRoomKey(String roomKey) {
		this.roomKey = roomKey;
	}

	public String getLabelColor() {
		return labelColor;
	}

	public void setLabelColor(String labelColor) {
		this.labelColor = labelColor;
	}

	public UserInfo getSender() {
		return sender;
	}

	public void setSender(UserInfo sender) {
		this.sender = sender;
	}

	public UserInfo getReceiver() {
		return receiver;
	}

	public void setReceiver(UserInfo receiver) {
		this.receiver = receiver;
	}

}
